#if !defined(__WEB_PAGE_PROTOCOL_CLOSEWINDOW_INCLUDE__)
#define __WEB_PAGE_PROTOCOL_CLOSEWINDOW_INCLUDE__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "MsHTMLHelper.h"

class WebPageProtocol_CloseWindow
{
public:
	static BOOL CloseWindow(IHTMLElement* pElement, IWebBrowser2* pBrowser, ICBHtmlCtrl* pCtrl, BSTR bstrUrl, 
		enumCBHtmlCtrlEventType eventType, IHTMLEventObj* pEventObj, IHTMLElement* pTriggerElement, IHTMLElement* pPramElement)
	{
		HWND hParent = ::GetParent(pCtrl->GetSafeHwnd()) ;
		::SendMessage(hParent, WM_CLOSE, NULL, NULL) ;

		return TRUE ;
	}
};

#endif // !defined(__WEB_PAGE_PROTOCOL_CLOSEWINDOW_INCLUDE__)